Reflecting Demand in Programming Logics: a case study for Haskell
نویسندگان
چکیده
Haskell is a functional programming language whose evaluation is lazy by default. However, Haskell also provides pattern matching facilities which add a modicum of eagerness to its otherwise lazy default evaluation. This mixed or “non-strict” semantics can be quite difficult to reason with. This paper introduces a programming logic, P-logic, which neatly formalizes the mixed evaluation in Haskell pattern-matching as a logic, thereby simplifying the task of specifying and verifying Haskell programs. In P-logic, aspects of demand are reflected or represented within both the predicate language and its model theory, allowing for expressive and comprehensible program verification.
منابع مشابه
Monad-Based Logics for Computational Effects
The presence of computational effects, such as state, store, exceptions, input, output, non-determinism, backtracking etc., complicates the reasoning about programs. In particular, usually for each effect (or each combination of these), an own logic needs to be designed. Monads are a well-known tool from category theory that originally has been invented for studying algebraic structures. Monads...
متن کاملPattern-driven Reduction in Haskell
Haskell is a functional programming language with nominally non-strict semantics, implying that evaluation of a Haskell expression proceeds by demand-driven reduction. However, Haskell also provides pattern matching on arguments of functions, in let expressions and in the match clauses of case expressions. Pattern-matching requires data-driven reduction to the extent necessary to evaluate a pat...
متن کاملA Stochastic Programming Approach for a Multi-Site Supply Chain Planning in Textile and Apparel Industry under Demand Uncertainty
In this study, a new stochastic model is proposed to deal with a multi-product, multi-period, multi-stage, multi-site production and transportation supply chain planning problem under demand uncertainty. A two-stage stochastic linear programming approach is used to maximize the expected profit. Decisions such as the production amount, the inventory level of finished and semi-finished product, t...
متن کاملA Scenario-Based Nonlinear Programming Model for a Two-Level Inventory Control Problem: A Case in Dairy Product Industry
In this paper, a novel scenario-based two-level inventory control model with a limited budget is formulated. The demand during the selling period is considered to follow a uniform probability distribution. In addition, it is assumed that there will be some customers who are willing to wait for their demands to be satisfied; thus a service level is considered for these customers. The aim is to f...
متن کاملProgramming logics - an introduction to verification and semantics
The best ebooks about Programming Logics An Introduction To Verification And Semantics that you can get for free here by download this Programming Logics An Introduction To Verification And Semantics and save to your desktop. This ebooks is under topic such as programs: semantics and verification springer p-logic: property verià ̄¥cation for haskell programs logic, semantics and verification ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2003